package sporteam.web.server;

import java.io.IOException;

import javax.jdo.PersistenceManager;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import sporteam.common.PMF;
import sporteam.web.client.AEuser;

@SuppressWarnings("serial")
public class GetUserByID extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
		throws ServletException, IOException {
	String id = req.getParameter("id");
	PersistenceManager pm = PMF.get()
			.getPersistenceManager();
	AEuser user = pm.getObjectById(AEuser.class, id);
	
	if(user == null)
		resp.getWriter().println("BUUGGGA");
	else{
		resp.getWriter().println(user.GetFirstName());
	}
		
	
}
}
